@extends('app')

@section('content')
<ul class="nav nav-tabs">
    <li class="active"><a href="{{ url('/admin/setting/menu')}}">分类列表</a></li>
    <li><a href="{{ url('/admin/setting/menu/create') }}">添加分类</a></li>
</ul>

<div class="panel panel-default description2 mt20">
    <div class="table-responsive panel-body">
        <table class="table table-hover">
            <thead>
                <tr>
                    <th>菜单名称</th>
                    <th>排序</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                @foreach($siteMenu as $key=>$sm)
                <tr  id="news_{{$sm->menu_id}}">
                    <td>
                        <font color="#428bca">
                        @if(count($sm->childrenMenu) > 0)
                        <i class="icon-chevron-down" id="father_{{$sm->menu_id}}"></i>
                        @endif 
                        {{ $sm->name }}</font>
                    </td>
                    <td>{{ $sm->display_order}}</td>
                    <td>
                        <a href="{{ url('/admin/setting/menu/'.$sm->menu_id.'/edit') }}"><i class="glyphicon glyphicon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                    </td>
                </tr>
                    @foreach($sm->childrenMenu as $subc)
                    <tr id="news_{{$subc->menu_id}}">
                        <td>
                            ｜－－ {{ $subc->name }} 
                            @if(count($subc->childrenMenu) > 0)
                            <font color="#428bca"><i class="icon-chevron-down" style="margin-left:20px;" id="father_{{$subc->menu_id}}"></i></font>
                            @endif
                        </td>
                        <td>{{ $subc->display_order}}</td>
                        <td>
                            <a href="{{ url('/admin/setting/menu/'.$subc->menu_id.'/edit?secondid='.$subc->menu_id) }}"><i class="glyphicon glyphicon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                        </td>
                    </tr>
                         @foreach($subc->childrenMenu as $thirdc)
                            <tr  id="news_{{$thirdc->menu_id}}">
                                <td>
                                    ｜－－－－ {{ $thirdc->name }}
                                </td>
                                <td>{{ $thirdc->display_order}}</td>
                                <td>
                                    <a href="{{ url('/admin/setting/menu/'.$thirdc->menu_id.'/edit?secondid='.$subc->menu_id.'&firstid='.$sm->menu_id) }}"><i class="glyphicon glyphicon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                                </td>
                            </tr>
                         @endforeach
                    @endforeach
                @endforeach
            </tbody>
        </table>
    </div>
</div>
@endsection
